package wnhz.com.business.shareshop.adapter;

import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;

import com.bumptech.glide.Glide;

import java.util.List;

import wnhz.com.business.R;
import wnhz.com.business.base.BaseRVAdapter;
import wnhz.com.business.base.BaseViewHolder;
import wnhz.com.business.groupshop.bean.OrderBean;

/**
 * Created by Administrator on 2018-01-21.
 */

public class OrderItemAdapter extends BaseRVAdapter {
   private List<OrderBean.InfoBean.GoodsBean> list;
    private Context context;
    /**
     * 构造器
     *
     * @param context 上下文
     * @param list    数据集合
     */
    public OrderItemAdapter(Context context, @NonNull List<OrderBean.InfoBean.GoodsBean> list) {
        super(context, list);
        this.list=list;
        this.context=context;
    }

    @Override
    public int getLayoutId(int viewType) {
        return R.layout.item_order_goods;
    }

    @Override
    public void onBind(BaseViewHolder holder, int position) {
        holder.setTextView(R.id.tv_good_name,list.get(position).getGoods_name());
        holder.setTextView(R.id.tv_sku,list.get(position).getSku_info());
        holder.setTextView(R.id.tv_good_orice,"押金 ￥ "+list.get(position).getGoods_price());
        holder.setTextView(R.id.tv_num,"x"+list.get(position).getGoods_nums());
        Glide.with(context).load(list.get(position).getGoods_pic()).into(holder.getImageView(R.id.img_logo));
    }
}
